<pre><code class="Bash"><xmp>result= Booking.objects.filter()
 
 
#方法一 .exists()
if result.exists():
    print "QuerySet has Data"
else:
    print "QuerySet is empty"
#方法二 .count()==0
if result.count() == 0:
    print "empty"
#方法三
if result:
    print "QuerySet has Data"
else:
    print "QuerySet is empty"
 
总结：
QuerySet.exists() > QuerySet.count()==0 > QuerySet</xmp></code></pre>